import request from "@/utils/request";
import qs from "qs";
import { Base64 } from "js-base64";
import {
  creationFolder_,
  FolderList_,
  deleteFolder_,
  uploadImage_,
  fileImageList_,
  deletedircPiD_,
} from "../../urlApi";
// 创建文件夹
export const creationFolder = (data) => {
  return request({
    url: creationFolder_,
    method: "post",
    data: qs.stringify(data),
  });
};
// 文件夹列表
export const FolderList = (data) => {
  return request({
    url: FolderList_,
    method: "post",
    data: qs.stringify(data),
  });
};
// 删除文件夹文件夹
export const deleteFolder = (data) => {
  return request({
    url: deleteFolder_,
    method: "post",
    data: qs.stringify(data),
  });
};
// 上传文件夹图片
export const uploadImage = (data) => {
  return request({
    url: uploadImage_,
    headers: {
      repeatSubmit: false,
      "Content-Type": "multipart/form-data",
    },
    method: "post",
    timeout: 60 * 60 * 1000,
    data,
  });
};
// 文件夹图片
export const fileImageList = (data) => {
  return request({
    url: fileImageList_,
    headers: {
      repeatSubmit: false,
    },
    method: "post",
    data: qs.stringify(data),
  });
};
// 删除图片
export const deletedircPiD = (data) => {
  return request({
    url: deletedircPiD_,
    headers: {
      repeatSubmit: false,
      "Content-Type": "application/json",
    },
    method: "post",
    data: JSON.stringify(data),
  });
};
